package com.yanu.t2s.controller;

import com.yanu.t2s.entity.Meat;
import com.yanu.t2s.service.MeatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@CrossOrigin
@RestController
@RequestMapping("meat")
public class MeatController {
    @Autowired
    MeatService meatService;
    @GetMapping("get/{id_meat}")
    public Meat findByIdMeat(@PathVariable int id_meat) {
        return meatService.findByIdMeat(id_meat);
    }

    @GetMapping("get/all")
    public List<Meat> findAllMeat() {
        return meatService.findAllMeat();
    }
}
